package com.ruoyi.system.wnjk.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.wnjk.domain.po.ShopOrderDetail;
import com.ruoyi.system.wnjk.mapper.ShopOrderDetailMapper;
import com.ruoyi.system.wnjk.service.IShopOrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 订单详情Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-07
 */
@Service
public class ShopOrderDetailServiceImpl implements IShopOrderDetailService
{
    @Autowired
    private ShopOrderDetailMapper shopOrderDetailMapper;

    /**
     * 查询订单详情
     *
     * @param id 订单详情主键
     * @return 订单详情
     */
    @Override
    public ShopOrderDetail selectShopOrderDetailById(Long id)
    {
        return shopOrderDetailMapper.selectShopOrderDetailById(id);
    }

    /**
     * 查询订单详情列表
     *
     * @param shopOrderDetail 订单详情
     * @return 订单详情
     */
    @Override
    public List<ShopOrderDetail> selectShopOrderDetailList(ShopOrderDetail shopOrderDetail)
    {
        return shopOrderDetailMapper.selectShopOrderDetailList(shopOrderDetail);
    }

    /**
     * 新增订单详情
     *
     * @param shopOrderDetail 订单详情
     * @return 结果
     */
    @Override
    public int insertShopOrderDetail(ShopOrderDetail shopOrderDetail)
    {
        shopOrderDetail.setCreateTime(DateUtils.getNowDate());
        return shopOrderDetailMapper.insertShopOrderDetail(shopOrderDetail);
    }

    /**
     * 修改订单详情
     *
     * @param shopOrderDetail 订单详情
     * @return 结果
     */
    @Override
    public int updateShopOrderDetail(ShopOrderDetail shopOrderDetail)
    {
        shopOrderDetail.setUpdateTime(DateUtils.getNowDate());
        return shopOrderDetailMapper.updateShopOrderDetail(shopOrderDetail);
    }

    /**
     * 批量删除订单详情
     *
     * @param ids 需要删除的订单详情主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderDetailByIds(Long[] ids)
    {
        return shopOrderDetailMapper.deleteShopOrderDetailByIds(ids);
    }

    /**
     * 删除订单详情信息
     *
     * @param id 订单详情主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderDetailById(Long id)
    {
        return shopOrderDetailMapper.deleteShopOrderDetailById(id);
    }
}
